                                                                     
                                             
/*
 * VendorItemBO.java
 *
 * Created on March 28, 2007, 8:19 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package finalintex2web;

/**
 *
 * @author Prabol Bhandari
 */
public class VendorItemBO {
    
    private String viguid;
    private boolean dirty = false;
    private boolean alreadyInDB = false;
    private double cost;
    private VendorBO vendor;
    private ConceptualProductBO conceptualprod;
    
    /** Creates a new instance of VendorItemBO */
    public VendorItemBO(String id) {
        this.viguid = id;
    }
    /*@return vendor guid
     *gets the vendor item guid
     */
    public String getViguid() {
        return viguid;
    }
    /**
     * This method enables us to know if the object is dirty. If the object is dirty then we need to update it in the database.
     *If the object is not dirty then we dont need to update the object in the database.
     * @return 
     */
    public boolean isDirty() {
        return dirty;
    }
     /**
     * 
     * @param dirty 
     * Sets the object as dirty or not dirty depending on the parameter passed.
     */
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
    /**
     * @return boolean indb 
     * This method is to check if this object is already set in the database or not.
     *
     */
    public boolean isAlreadyInDB() {
        return alreadyInDB;
    }
     /**
     * @param indb
     * Sets the indb variable to whatever is passed in indb.
     *This method is to tell the object that this object has already been saved or not saved in the database. 
     */
    public void setAlreadyInDB(boolean alreadyInDB) {
        this.alreadyInDB = alreadyInDB;
    }
    /*@return vendor
     *gets the name of the vendor
     */
    public VendorBO getVendor() {
        return vendor;
    }
    
    /*@param vendor
     *sets the name of the vendor
     */
    public void setVendor(VendorBO vendor) {
        this.vendor = vendor;
        this.dirty = true;
    }
    
    /*@return conceptual product
     *gets the conceptual product
     */
    public ConceptualProductBO getConceptualprod() {
        return conceptualprod;
    }
    
    /*@param conceptual product
     *sets the conceptual product
     */
    public void setConceptualprod(ConceptualProductBO conceptualprod) {
        this.conceptualprod = conceptualprod;
        this.dirty = true;
    }
    
    /*@return cost
     *gets the cost 
     */
    public double getCost() {
        return cost;
    }
    /*@param cost
     *sets the cost 
     */
    public void setCost(double cost) {
        this.cost = cost;
    }
    
}
